home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.3 KB | 166 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWShpLst.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSHPLST_H
- #define FWSHPLST_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWENVDEF_H
- #include "FWEnvDef.h"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- #ifndef FWCOUPTR_H
- #include "FWCouPtr.h"
- #endif
-
- #ifndef FWTCOLL_H
- #include "FWTColl.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
- class FW_CPoint;
- class FW_CRect;
- class FW_CReadableStream;
- class FW_CWritableStream;
-
- //========================================================================================
- // class FW_CShapeListRep
- //========================================================================================
-
- class FW_CShapeListRep : public FW_MCountedPtrRep
- {
-
- friend class FW_CShapeListIterator;
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
-
- FW_DECLARE_AUTO(FW_CShapeListRep)
-
- FW_CShapeListRep();
- FW_CShapeListRep(const FW_CShapeListRep& other);
- FW_CShapeListRep(FW_CReadableStream& stream);
- ~FW_CShapeListRep();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
-
- public:
- void Write(FW_CWritableStream& stream) const;
- FW_Boolean IsEqual(const FW_CShapeListRep* other) const;
-
- // ----- Adding shapes
-
- void AdoptAtTop(FW_CShape* shape);
- void AdoptAtBottom(FW_CShape* shape);
- void AdoptBelow(FW_CShape* shapeToAdd, FW_CShape* belowWhich);
- void AdoptAbove(FW_CShape* shapeToAdd, FW_CShape* aboveWhich);
-
- // ----- Removing shapes
-
- void Remove(FW_CShape* shape);
- void RemoveAll();
- void DeleteAll();
- FW_CShape* RemoveTop();
- FW_CShape* RemoveBottom();
-
- // ----- List operations
-
- FW_Boolean Contains(FW_CShape* shape) const;
- unsigned long GetCount() const;
- void Purge();
-
- // ----- Z-Order methods
-
- FW_Boolean MoveUp(FW_CShape* shape);
- FW_Boolean MoveToTop(FW_CShape* shape);
-
- FW_Boolean MoveDown(FW_CShape* shape);
- FW_Boolean MoveToBottom(FW_CShape* shape);
-
- // ----- Anchor Point
- FW_CPoint GetAnchorPoint() const;
-
- //----------------------------------------------------------------------------------------
- // Internal API
- //
- private:
- void PrivFree();
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_TOrderedCollection<FW_CShape>* fShapeList;
- FW_Boolean fValidAnchorPoint;
- FW_CPoint fAnchorPoint;
- };
-
- //========================================================================================
- // class FW_PShapeList
- //========================================================================================
-
- class FW_PShapeList : public FW_TCountedPtr<FW_CShapeListRep>
- {
- public:
- FW_PShapeList();
- FW_PShapeList(FW_CReadableStream& stream);
- virtual ~FW_PShapeList();
-
- FW_PShapeList(const FW_PShapeList& other);
- FW_PShapeList& operator=(const FW_PShapeList& other);
-
- FW_PShapeList Copy() const;
-
- friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_PShapeList& list);
- friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_PShapeList& list);
- };
-
- //========================================================================================
- // class FW_CShapeListIterator
- //========================================================================================
-
- class FW_CShapeListIterator : public FW_TOrderedCollectionIterator<FW_CShape>
- {
- public:
- FW_DECLARE_AUTO(FW_CShapeListIterator)
-
- FW_CShapeListIterator(const FW_PShapeList& shapeList) :
- FW_TOrderedCollectionIterator<FW_CShape>(shapeList->fShapeList) {}
- FW_CShapeListIterator(const FW_CShapeListRep& shapeListRep) :
- FW_TOrderedCollectionIterator<FW_CShape>(shapeListRep.fShapeList) {}
- ~FW_CShapeListIterator() {}
- };
-
-
-
- #endif
-